define(function (require, exports) {
    var base = require("customize/ui/base");

    exports.processing = function (message, target) {
        var progress = $(".waiting-modal");
        if (message === 'close') {
            progress.modal('hide');
            return;
        }

        if (progress.size() == 0) {
            $(target || "body").append('<div class="waiting-modal modal">' +
            '<div class="modal-header"> ' +
            '<h3>处理对话框</h3>' +
            '</div>' +
            '<div class="modal-body" style="height: 500px;">' +
            '<p>' + (message || "正在处理中...") + '</p>' +
            '</div>' +
            '</div>');
        }
        $('.waiting-modal').modal('show');
    };
});